package com.artconcurrency.chapter4;

import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;

/**
 * @ClassName com.artconcurrency.chapter4
 * Description: <类功能描述>. <br>
 * <p>
[5] Monitor Ctrl-Break
[4] Signal Dispatcher   分发处理发送给JVM信号的线程
[3] Finalizer   调用对象finalize的线程
[2] Reference Handler   清除reference的线程
[1] main    main线程，用户入口
 * </p>
 * @Author tree
 * @Date 2019-05-01 17:44
 * @Version 1.0
 */
public class MultiThread {
    public static void main(String[] args) {
        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
        ThreadInfo[]  threadInfos = threadMXBean.dumpAllThreads(false,false);
        for (ThreadInfo t :
                threadInfos) {
            System.out.println("["+t.getThreadId()+"] "+ t.getThreadName());
        }
    }
}
